package cn.tedu.boot22.mapper;

import cn.tedu.boot22.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author Administrator
 */
@Mapper
public interface UserMapper {
    @Insert("insert into user values(null,#{username},#{password},#{nick})")
    void insert(User user);

    @Delete("delete from user where username=#{username}")
    void deleteByName(String username);

    @Update("update user set username=#{username},password=#{password},nick=#{nick} where id=#{id}")
    void update(User user);

    @Select("select * from user")
    List<User> select();
}
